package com.code;

import com.landmesure.settings.fragment.argsinfo.ArgumentsInfo;

import java.util.ArrayList;
import java.util.List;


public class EntityType implements Cloneable {


    private int code;//小类编码
    private String ename;
    private String iconCls;
    private int mcode;//大类编码
    private String mname;//父对象名称
    private String name;//对象名称
    private int ecode;//对象编码
    private int fcode=-1;
    private List<PropertyDefinition> propertyDefinitions;//属性集合
    private List<RelationDefinition> relationDefinitions;//对象关系集合

    public int getEcode() {
        return ecode;
    }

    public void setEcode(int ecode) {
        this.ecode = ecode;
    }

    public int getFcode() {
        return fcode;
    }

    public void setFcode(int fcode) {
        this.fcode = fcode;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public String getIconCls() {
        return iconCls;
    }

    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }

    public int getMcode() {
        return mcode;
    }

    public void setMcode(int mcode) {
        this.mcode = mcode;
    }

    public String getMname() {
        return mname;
    }

    public void setMname(String mname) {
        this.mname = mname;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<PropertyDefinition> getPropertyDefinitions() {
        return propertyDefinitions;
    }

    public void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions) {
        this.propertyDefinitions = propertyDefinitions;
    }

    public List<RelationDefinition> getRelationDefinitions() {
        return relationDefinitions;
    }

    public void setRelationDefinitions(List<RelationDefinition> relationDefinitions) {
        this.relationDefinitions = relationDefinitions;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();

    }

    /**
     * 转换为argumentsInfo结构
     */
    public ArrayList<ArgumentsInfo> copySelf() {
        ArrayList<ArgumentsInfo> infos = new ArrayList<>();
        for (PropertyDefinition pd : propertyDefinitions) {
            infos.add(pd.copySelf());
        }
        return infos;
    }
}
